<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/generic/taglibs.jsp"%>
<s:layout-render name="/WEB-INF/jsp/generic/layout.jsp">

	<s:layout-component name="pageContent">
	<div class="content">

		<fieldset>
			<legend><c:choose>
				<c:when test="${ not empty actionBean.q }"><fmt:message bundle="${bundle }" key="search.results"><fmt:param>${ actionBean.q }</fmt:param></fmt:message></c:when>
				<c:otherwise><fmt:message bundle="${bundle }" key="search.registeredMembers" /></c:otherwise>
			</c:choose></legend>
			
			<%-- <p><s:form action="${actionBean.url }" focus="first">
				<s:errors field="searchQuery" />
				<s:text name="searchQuery"/> <s:submit name="search">Rechercher</s:submit>
			</s:form></p> --%>
			
			<c:choose>
				<c:when test="${ not empty actionBean.membersFound.list }">
					<table>
						<thead>
							<tr>
								<th><fmt:message bundle="${bundle }" key="newMember.lastName" /></th>
								<th><fmt:message bundle="${bundle }" key="newMember.firstName" /></th>
								<th><fmt:message bundle="${bundle }" key="newMember.sex" /></th>
								<th><fmt:message bundle="${bundle }" key="newMember.chineseName" /></th>
								<th><fmt:message bundle="${bundle }" key="newMember.parisTechEntranceYear" /></th>
								<th><fmt:message bundle="${bundle }" key="newMember.parisTechSchool" /></th>
								<th><fmt:message bundle="${bundle }" key="newMember.chineseUniversity" /></th>
								
								<%-- <th><fmt:message bundle="${bundle }" key="newMember.birthDate" /></th>
								<th><fmt:message bundle="${bundle }" key="newMember.country" /></th>
								<th><fmt:message bundle="${bundle }" key="newMember.email" /></th>
								<th><fmt:message bundle="${bundle }" key="newMember.phone" /></th>
								<th><fmt:message bundle="${bundle }" key="newMember.weibo" /></th>
								<th><fmt:message bundle="${bundle }" key="newMember.weixin" /></th>
								
								<th><fmt:message bundle="${bundle }" key="newMember.employer" /></th>
								<th><fmt:message bundle="${bundle }" key="newMember.currentJobCountry" /></th>
								<th><fmt:message bundle="${bundle }" key="newMember.job" /></th> --%>
							</tr>
						</thead>
						<c:forEach items="${actionBean.membersFound.list}" var="member">
							<tr>
								<%-- <ss:secure roles="${actionBean.roleVisible }">
								<a href="${contextPath}${actionBean.memberDetailUrl}/${member.login.id}"></ss:secure>
								${member.firstName}  ${member.lastName}
								<ss:secure roles="${actionBean.roleVisible }"></a></ss:secure> --%>
								
								<ss:secure roles="${actionBean.roleVisible }">
									
									<%-- <c:set><c:out value="${member.login.id}"></c:out> </c:set> --%>
									<td><a href="${contextPath}${actionBean.memberDetailUrl}/${m:urlenc(member.id) }">${member.lastName}</a></td>
									<td><a href="${contextPath}${actionBean.memberDetailUrl}/${m:urlenc(member.id) }">${member.firstName}</a></td>
									<td><c:if test="${not empty member.sex}"><fmt:message bundle="${bundle }" key="${member.sex}" /></c:if></td>
									<td>${member.chineseName}</td>
									<td><c:if test="${member.parisTechEntranceYear != 0}">${member.parisTechEntranceYear}</c:if></td>
									<td>${member.parisTechSchool}</td>
									<td>${member.chineseUniversity}</td>
									
									<%-- <td><fmt:formatDate value="${member.birthDate}" type="date" dateStyle="short" /></td>
									<td>${member.country}</td>
									<td>${member.email}</td>
									<td>${member.phone}</td>
									<td>${member.weibo}</td>
									<td>${member.weixin}</td>
									<td>${member.employer}</td>
									<td>${member.currentJobCountry}</td>
									<td>${member.job}</td> --%>
									
								</ss:secure>
								
								<ss:secure roles="${actionBean.roleNotVisible }">
									
									<td>${member.firstName}  ${member.lastName}</td>
									
								</ss:secure>
							</tr>
						</c:forEach>
					</table>
				</c:when>
				<c:otherwise><p><fmt:message bundle="${bundle }" key="search.noresults" /></p></c:otherwise>
			</c:choose>
			
			<%-- <c:url var="previousPageUrl" value="${thisUrl}">
				<c:param name="p" value="${ actionBean.previousPage }" />
			</c:url>
			<c:url var="nextPageUrl" value="${thisUrl}">
				<c:param name="p" value="${ actionBean.nextPage }" />
			</c:url> --%>
			<p><c:if test="${ actionBean.membersFound.hasPreviousPage }"><a href="${ actionBean.membersFound.previousPageUrl }"><fmt:message bundle="${bundle }" key="search.previousPage" /></a></c:if>
			Page ${ actionBean.membersFound.page } / ${ actionBean.membersFound.pMax }
			<c:if test="${ actionBean.membersFound.hasNextPage }"><a href="${ actionBean.membersFound.nextPageUrl }"><fmt:message bundle="${bundle }" key="search.nextPage" /></a></c:if></p>
			
		</fieldset>
		

	</div>
	</s:layout-component>

</s:layout-render>